        <link rel="stylesheet" href="<?php echo base_url()?>/public/assets/css/weui.css"/>
        <link rel="stylesheet" href="<?php echo base_url()?>/public/assets/css/font-awesome.css">
        
        <style type="text/css">
            table {  
                border-collapse: collapse;     
                border: 1px solid #999;
                width: 100%;  
                text-align: center; 
                
              }    
                
              td {  
                border: 1px solid #999;  
                width: 15%;
                height: 60px;
                
              } 
                 input[type="checkbox"] {
                      -webkit-appearance: none;
                    }
                
                input[type="checkbox"] {
                    -webkit-appearance: none;
                    background-color: #fff;
                    border-radius: 100%;
                    height: 30px;
                    vertical-align: middle;
                    width: 30px; 
                    border:2px solid #999;
                    margin-top: 6px;
                    }
                input[type="checkbox"]:checked {
                    background-color:#26ca28;
                    border-color:#26ca28;
                    }
                input:focus {
                    outline:none;
                }
                @media all and (min-width: 800px) { 
                   td{line-height: 60px;} 
                   input[type="checkbox"] {
                    margin-top: -4px;
                    }
                 }
        </style>
    	<div>
    		<form action="/admin/holiday/add" id="holiday_form" method="post">
			<select id="y" name="y" onchange="riqi(value)">
			<?php for ($i=1;$i<=12;$i++){?>
				<option value="<?php echo $i?>"><?php echo $i?>月</option>
			<?php }?>
			</select>
			&nbsp;&nbsp;&nbsp;
			<select id="r" name="r">
				
			</select>
			&nbsp;&nbsp;&nbsp;
			<input type="button" value="添加" onclick="yanzheng();" class="btn btn-info_01 float_right btn_search"/>
			</form>
    	</div>
        <div class="weui_media_box weui_media_text">
<!--             <h4 class="weui_media_title">修改上课时段</h4> -->
            <form action="/nursery/teacher/updatetime" method="post" onSubmit="return yanzheng()">
            <input type="hidden" value="update" name="form_submit" />
            <div class="weui_media_desc">
                <table>
                    	<?php foreach ($holiday_time_list as $key=>$val){?>
                    	<?php if($key%6 == 0){?>
                    	<tr valign="middle">
                    	<?php }?>
                        <td><label>
                            <input type="checkbox" <?php echo $val['status'] == 1 ? 'checked':'';?> value="<?php echo $val['holiday']?>" id="<?php echo $val['id']?>" name="" onChange="Updatetimeajax(this)"/>
                            <?php $holiday = explode('-',$val['holiday']);echo $holiday[0].'月-'.$holiday[1].'日'?>
							</label>
                        </td>
                        <?php if($key%5==0 && $key!=0){?>
                    	</tr>
                    	<?php }?>
                        <?php }?>
                </table>
				</form>
            </div>
        </div>
<script>
riqi(1);
function yanzheng(){
	var y = $('#y').val();
	var r = $('#r').val();
	if(confirm('确定要添加吗？')){
	   $.ajax({
			 type: 'get',
			 url: '/admin/holiday/gettime?y='+y+'&r='+r,
			 async : false,
			 dataType: 'json',
			 success: function (d){
				 if(d['code'] == 10){
					 document.getElementById('holiday_form').submit();
				}else{
					alert(d['msg']);
				}
			 },
		});
	}
}
function riqi(id){
	var content = '';
	for(var i=1;i<=31;i++){
		if(id==2 && i>28)break;
		if((id==4 || id==6 || id==9 ||id==11) && i > 30 )break;
		content +='<option value="'+i+'">'+i+'日</option>';
	}
	$('#r').html(content);
}
/**
 * 修改时间
 */
function Updatetimeajax(object){
	var ob_id = $(object).attr('id');
	var ob_checked = $(object).is(':checked');
	//alert(ob_checked);
	   $.ajax({
			 type: 'get',
			 url: '/admin/holiday/updatetimeajax?id='+ob_id+'&checked='+ob_checked,
			 async : false,
			 dataType: 'json',
			 success: function (d){
				 if(d['code'] == 10){
					 //$(object).attr('id',d['id']);
				}else{
					if(ob_checked){
						$(object).attr('checked',false);
					}else{
						$(object).attr('checked',true);
					}
					alert(d['msg']);
				}
			 },
		});
	//alert(ob_checked);
}
</script>